<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
	<script type="text/javascript">
		var str = 'asdfsad张fjsdsf是的冯绍峰的水张电费23423士大夫撒地方';
		/////两张之间的字符
		//1
		var str2=str.split('张');
		console.log(str2[1]);
		//2.
		var firstIndex = str.indexOf('张');
		var secondIndex = str.indexOf('张',firstIndex+1)
		console.log(str.substring(firstIndex+1,secondIndex))
		//冯绍峰与士大夫之间的字符
		//1.
		var firstIndex1 = str.indexOf('冯绍峰')+3; 
		var firstIndex2 = str.indexOf('士大夫'); 
		console.log(str.substring(firstIndex1,firstIndex2))
		
		//2
		var arr=str.split('冯绍峰');
		var arr2=arr[1].split('士大夫');
		console.log(arr2[0])
		
	</script>
</html>
